//
//  HomeQuestionHeadView.m
//  ZJControlsClass
//
//  Created by mac on 2024/11/18.
//

#import "HomeQuestionHeadView.h"






@implementation HomeQuestionHeadView



- (instancetype)initWithFrame:(CGRect)frame{
    
    self = [super initWithFrame:frame];
    
    if (self){
        
        [self configUI];
        
    }
    return self;
}

-(void)configUI{
    
    [self addSubview:self.typeLabel];
    [self addSubview:self.msgLabel];
    
    [self.typeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self).with.offset(ALIGN_WIDTH_PT(15));
        make.top.equalTo(self).with.offset(ALIGN_HEIGHT_PT(10));
        make.height.equalTo(@(ALIGN_HEIGHT_PT(20)));
    }];
    
    [self.msgLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.typeLabel.mas_left);
        make.right.equalTo(self).with.offset(-ALIGN_WIDTH_PT(15));
        make.top.equalTo(self.typeLabel.mas_bottom).with.offset(ALIGN_HEIGHT_PT(15));
    }];
    
    
}



#pragma mark -- 懒加载
-(UILabel *)typeLabel{
    if (!_typeLabel){
        _typeLabel = [UILabel new];
        _typeLabel.textColor = [UIColor whiteColor];
        _typeLabel.font = FONT11;
        _typeLabel.textAlignment = NSTextAlignmentCenter;
        _typeLabel.backgroundColor = COLOR_RGB(50, 113, 237);
        _typeLabel.layer.cornerRadius = 3;
        _typeLabel.layer.masksToBounds = YES;
    }
    return _typeLabel;
}

-(UILabel *)msgLabel{
    if (!_msgLabel){
        _msgLabel = [UILabel new];
        _msgLabel.textColor = [UIColor blackColor];
        _msgLabel.font = [UIFont systemFontOfSize:15 weight:0.5];
        _msgLabel.textAlignment = NSTextAlignmentLeft;
        _msgLabel.numberOfLines = 0;
    }
    return _msgLabel;
}




@end
